﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SDMX_Common = SDMX_ML.Framework.Common;

namespace SDMX_ML.Framework.Structure
{
    /// <summary>
    /// LevelType.
    /// </summary>
    public class LevelType
    {
        private SDMX_Common.IDType _id;
        private string _urn;
        private List<SDMX_Common.TextType> _name;
        private List<SDMX_Common.TextType> _description;
        private int? _order;
        private TextFormatType _codingType;
        private SDMX_Common.AnnotationsType _annotations;

        /// <summary>
        /// LvelType.
        /// </summary>
        /// <param name="name">Name.</param>
        /// <param name="order">Order.</param>
        /// <param name="id">Id.</param>
        public LevelType(SDMX_Common.TextType name, int? order, SDMX_Common.IDType id)
        {
            if (name != null & order != null & id != null)
            {
                _name = new List<SDMX_Common.TextType>();
                _description = new List<SDMX_Common.TextType>();

                _name.Add(name);
                _id = id;
                _order = order;
            }
            else
            {
                throw new Exception("Elements Name and order and attribute id are required in LevelType.");
            }
        }
        
        //Elements
        /// <summary>
        /// Name.
        /// </summary>
        public List<SDMX_Common.TextType> Name
        {
            get { return _name; }
            set { _name = value; }
        }

        /// <summary>
        /// Description.
        /// </summary>
        public List<SDMX_Common.TextType> Description
        {
            get { return _description; }
            set { _description = value; }
        }

        /// <summary>
        /// Order.
        /// </summary>
        public int? Order
        {
            get { return _order; }
            set { _order = value; }
        }
        
        /// <summary>
        /// CodingType.
        /// </summary>
        public TextFormatType CodingType
        {
            get { return _codingType; }
            set { _codingType = value; }
        }

        /// <summary>
        /// Annotations.
        /// </summary>
        public SDMX_Common.AnnotationsType Annotations
        {
            get { return _annotations; }
            set { _annotations = value; }
        }

        //Attributes
        /// <summary>
        /// Id.
        /// </summary>
        public SDMX_Common.IDType Id
        {
            get { return _id; }
            set { _id = value; }
        }
        
        /// <summary>
        /// Urn.
        /// </summary>
        public string Urn
        {
            get { return _urn; }
            set { _urn = value; }
        }

    }
}
